import requests from '@src/common/request'

export function getStoreList(data) {
  return requests.post({
    url: '/mall/anon/store/list',
    data: data
  })
}

//获取附近门店
export function getNearStore(data) {
  return requests.get({
    url: '/mall/anon/store/nearby_store',
    data: data
  })
}

//获取附近门店
export function checkLocalDelivery(data) {
  return requests.get({
    url: '/mall/anon/store/check_local_delivery',
    data: data
  })
}

//获取配送方式
export function getDispatchWay(data) {
  return requests.post({
    url: '/mall/anon/menu/getItemsDelivery',
    data: data
  })
}

//获取店铺详情
export function getStoreDetail(req) {
  if (req.latitude) {
    return requests.get('/mall/anon/store/detail?storeId=' + req.storeId + '&latitude=' + req.latitude + "&longitude=" + req.longitude)
  } else {
    return requests.get('/mall/anon/store/detail?storeId=' + req.storeId)
  }
}
